package com.hz.erp.enums.commons;

/**
 * @author 柯鑫
 * @ClassName com.hz.erp.enums.commons.RegistrationWay
 * @description 注册方式
 * @create 2020年06月11日 10:07
 */
public enum RegistrationWayEnum {

    COME_ERP("erp", "erp注册"),
    COME_ANDROID("android", "安卓注册");

    private String code;
    private String desc;

    RegistrationWayEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String setCodeGetDesc(String code){
        for(RegistrationWayEnum value : RegistrationWayEnum.values() ){
            if(value.getCode().equals(code)){
                return value.getDesc();
            }
        }

        return null;
    }

    public static String setDescGetCode(String desc){
        for(RegistrationWayEnum value : RegistrationWayEnum.values()){
            if(value.getDesc().equals(desc)){
                return value.getCode();
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

}
